-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BugFix] Fix the mem_tracker use-after-free of UDF #41710
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: trueeyu <lxhhust350@qq.com>
stdpain
approved these changes
Feb 27, 2024
mxdzs0612
approved these changes
Feb 27, 2024
silverbullet233
approved these changes
Feb 27, 2024
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]❌ fail : 0 / 7 (00.00%) file detail
|
@Mergifyio backport branch-3.2 |
@Mergifyio backport branch-3.1 |
@Mergifyio backport branch-3.0 |
@Mergifyio backport branch-2.5 |
✅ Backports have been created
|
✅ Backports have been created
|
✅ Backports have been created
|
✅ Backports have been created
|
mergify bot
pushed a commit
that referenced
this pull request
Feb 27, 2024
## Why I'm doing: ``` *** Aborted at 1686120661 (unix time) try "date -d @1686120661" if you are using GNU date *** PC: @ 0x2ce0b61 starrocks::MemTracker::consume() *** SIGSEGV (@0x0) received by PID 117789 (TID 0x7f9cd0728700) from PID 0; stack trace: *** @ 0x58f9dc2 google::(anonymous namespace)::FailureSignalHandler() @ 0x7f9d147ae362 (unknown) @ 0x7f9d147b28b9 JVM_handle_linux_signal @ 0x7f9d147a5f78 (unknown) @ 0x7f9d13ce1390 (unknown) @ 0x2ce0b61 starrocks::MemTracker::consume() @ 0x486d328 _ZNSt17_Function_handlerIFvvEZN9starrocks24call_function_in_pthreadEPNS1_12RuntimeStateERKSt8functionIFNS1_6StatusEvEEEUlvE_E9_M_invokeERKSt9_Any_data @ 0x475fbe0 starrocks::PriorityThreadPool::work_thread() @ 0x58b97e7 thread_proxy @ 0x7f9d13cd76ba start_thread @ 0x7f9d132f841d clone @ 0x0 (unknown) ``` After `promise->set_value`, if runtime state of query is first destructed, then release the memory, the mem_tracker has already been free, so it will be crash here. ## What I'm doing: Release the mem first, and then set promise value. Signed-off-by: trueeyu <lxhhust350@qq.com> (cherry picked from commit e36a684)
mergify bot
pushed a commit
that referenced
this pull request
Feb 27, 2024
## Why I'm doing: ``` *** Aborted at 1686120661 (unix time) try "date -d @1686120661" if you are using GNU date *** PC: @ 0x2ce0b61 starrocks::MemTracker::consume() *** SIGSEGV (@0x0) received by PID 117789 (TID 0x7f9cd0728700) from PID 0; stack trace: *** @ 0x58f9dc2 google::(anonymous namespace)::FailureSignalHandler() @ 0x7f9d147ae362 (unknown) @ 0x7f9d147b28b9 JVM_handle_linux_signal @ 0x7f9d147a5f78 (unknown) @ 0x7f9d13ce1390 (unknown) @ 0x2ce0b61 starrocks::MemTracker::consume() @ 0x486d328 _ZNSt17_Function_handlerIFvvEZN9starrocks24call_function_in_pthreadEPNS1_12RuntimeStateERKSt8functionIFNS1_6StatusEvEEEUlvE_E9_M_invokeERKSt9_Any_data @ 0x475fbe0 starrocks::PriorityThreadPool::work_thread() @ 0x58b97e7 thread_proxy @ 0x7f9d13cd76ba start_thread @ 0x7f9d132f841d clone @ 0x0 (unknown) ``` After `promise->set_value`, if runtime state of query is first destructed, then release the memory, the mem_tracker has already been free, so it will be crash here. ## What I'm doing: Release the mem first, and then set promise value. Signed-off-by: trueeyu <lxhhust350@qq.com> (cherry picked from commit e36a684)
mergify bot
pushed a commit
that referenced
this pull request
Feb 27, 2024
## Why I'm doing: ``` *** Aborted at 1686120661 (unix time) try "date -d @1686120661" if you are using GNU date *** PC: @ 0x2ce0b61 starrocks::MemTracker::consume() *** SIGSEGV (@0x0) received by PID 117789 (TID 0x7f9cd0728700) from PID 0; stack trace: *** @ 0x58f9dc2 google::(anonymous namespace)::FailureSignalHandler() @ 0x7f9d147ae362 (unknown) @ 0x7f9d147b28b9 JVM_handle_linux_signal @ 0x7f9d147a5f78 (unknown) @ 0x7f9d13ce1390 (unknown) @ 0x2ce0b61 starrocks::MemTracker::consume() @ 0x486d328 _ZNSt17_Function_handlerIFvvEZN9starrocks24call_function_in_pthreadEPNS1_12RuntimeStateERKSt8functionIFNS1_6StatusEvEEEUlvE_E9_M_invokeERKSt9_Any_data @ 0x475fbe0 starrocks::PriorityThreadPool::work_thread() @ 0x58b97e7 thread_proxy @ 0x7f9d13cd76ba start_thread @ 0x7f9d132f841d clone @ 0x0 (unknown) ``` After `promise->set_value`, if runtime state of query is first destructed, then release the memory, the mem_tracker has already been free, so it will be crash here. ## What I'm doing: Release the mem first, and then set promise value. Signed-off-by: trueeyu <lxhhust350@qq.com> (cherry picked from commit e36a684)
18 tasks
This was referenced Feb 27, 2024
mergify bot
pushed a commit
that referenced
this pull request
Feb 27, 2024
## Why I'm doing: ``` *** Aborted at 1686120661 (unix time) try "date -d @1686120661" if you are using GNU date *** PC: @ 0x2ce0b61 starrocks::MemTracker::consume() *** SIGSEGV (@0x0) received by PID 117789 (TID 0x7f9cd0728700) from PID 0; stack trace: *** @ 0x58f9dc2 google::(anonymous namespace)::FailureSignalHandler() @ 0x7f9d147ae362 (unknown) @ 0x7f9d147b28b9 JVM_handle_linux_signal @ 0x7f9d147a5f78 (unknown) @ 0x7f9d13ce1390 (unknown) @ 0x2ce0b61 starrocks::MemTracker::consume() @ 0x486d328 _ZNSt17_Function_handlerIFvvEZN9starrocks24call_function_in_pthreadEPNS1_12RuntimeStateERKSt8functionIFNS1_6StatusEvEEEUlvE_E9_M_invokeERKSt9_Any_data @ 0x475fbe0 starrocks::PriorityThreadPool::work_thread() @ 0x58b97e7 thread_proxy @ 0x7f9d13cd76ba start_thread @ 0x7f9d132f841d clone @ 0x0 (unknown) ``` After `promise->set_value`, if runtime state of query is first destructed, then release the memory, the mem_tracker has already been free, so it will be crash here. ## What I'm doing: Release the mem first, and then set promise value. Signed-off-by: trueeyu <lxhhust350@qq.com> (cherry picked from commit e36a684)
18 tasks
wanpengfei-git
pushed a commit
that referenced
this pull request
Feb 27, 2024
wanpengfei-git
pushed a commit
that referenced
this pull request
Feb 27, 2024
wanpengfei-git
pushed a commit
that referenced
this pull request
Feb 27, 2024
wanpengfei-git
pushed a commit
that referenced
this pull request
Feb 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why I'm doing:
After
promise->set_value
, if runtime state of query is first destructed, then release the memory, the mem_tracker has already been free, so it will be crash here.What I'm doing:
Release the mem first, and then set promise value.
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: